package com.cpr.demo.mycraft.mq.redis;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author Chen Panrui
 * created at 2021/10/19 14:10
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class RedisMessage {

    private String messageId;
    /**
     * 可以是 json字符串，自己处理自己的逻辑
     * {@link MessageHandler#handle(String)}
     */
    private String message;

    public static RedisMessage buildMessage(String id, String message){
        return new RedisMessage(id, message);
    }
}
